<template>
	<view>
		<navbar :isback="false" title="联系客服"></navbar>
		<view class="title">
			~长按二维码添加微信~
		</view>
		<!-- <view class="qrbox">
			
		</view> -->
		<!-- <u-loading-page icon-size="100rpx" :loading="loading" loading-text="驼乡生活信息超市"></u-loading-page> -->
		<image :src="wechatImage" :show-menu-by-longpress="true" class="qrbox"></image>
		<view class="footer">
			<u-button @click="bc" text="保存二维码" size="large" icon="/static/fabu/bc.png" shape='circle'
				color="linear-gradient(87deg, #3494FF, #3989FF)" :customStyle="{height:'100rpx'}"></u-button>
		</view>
	</view>
</template>

<script>
	import { BASE_URL } from '@/api/config';
	import home from '@/api/_home.js';
	export default {
		data() {
			return {
				wechatImage:'',
				loading:true	
			};
		},
		methods: {
			bc() {
				let _this=this
				uni.getImageInfo({
					src: _this.wechatImage,
					success: function(image) {
						uni.saveImageToPhotosAlbum({
							filePath: image.path,
							success: function() {
								uni.$u.toast('保存成功')
							},
							fail() {
								uni.$u.toast('保存失败')
							}
						});
					}
				});
			}
		},
		onLoad() {
			home.readConfig({configName:'wechatImage'}).then(res=>{
				if(res.data.code==1){
					this.wechatImage=BASE_URL+res.data.data.wechatImage
					// this.loading=false
				}
			})
		}
	}
</script>

<style lang="scss">
	.title {
		text-align: center;
		padding-top: 156rpx;
		font-family: PingFang SC;
		font-weight: bold;
		font-size: 30rpx;
		color: #1E1E1E;
		line-height: 30rpx;
	}

	.qrbox {
		margin: 52rpx 160rpx 74rpx;
		width: 410rpx;
		height: 410rpx;
		background: #fff;
		box-shadow: 0rpx 0rpx 38rpx 0rpx rgba(3, 119, 226, 0.19);
		border-radius: 30rpx;
		// border: 10px solid rgba(255, 255, 255, 0.4);
	}

	.footer {
		padding: 0 140rpx;

		/deep/.u-icon--right {
			margin-right: 10rpx;
		}
	}
</style>